# Makefile

BINARY=lib_news.so
# 使用与glibc 2.32兼容的更低版本golang镜像
GO_VERSION=1.18

GO_BUILD=docker run --rm \
    -v $(PWD):/app \
    -v $(HOME)/go:/go \
    -w /app \
    -e GOPROXY=https://goproxy.cn,direct \
    golang:$(GO_VERSION) \
    go build -o $(BINARY) -buildmode=c-shared

all: clean build

build:
	$(GO_BUILD) main.go

clean:
	rm -f $(BINARY) $(BINARY:.so=.h)